<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .grandfather{
            width: 300px;
            height: 300px;
            background: purple;
        }
        .father{
            width: 200px;
            height: 200px;
            background: red;
        }
        .son{
            width: 100px;
            height: 100px;
            background: blue;
        }
    </style>
    <script src="../js/jquery-1.12.4.min.js"></script>
    <script>
        $(function () {

            $('.son').click(function () {
                alert(1);
            });

            // 父级阻止事件冒泡
            $('.father').click(function (event) {
                alert(2);
                event.stopPropagation();
            });

            $('.grandfather').click(function () {
                alert(3);
            });

            // 代表最顶级标签
            $(document).click(function () {
                alert(4);
            });
        })


    </script>
</head>
<body>

    <div class="grandfather">
        <div class="father">
            <div class="son"></div>
        </div>
    </div>

</body>
</html>